<template>
	<view>
		<view class="worklist" v-for="(item,index) in list" :key="index">
			<view @click="tomore(item.ticketNum)">
				<text>{{item.ticketName}}</text><br>
				<text>工单编号:{{item.ticketNum}}</text><br>
				<text>班次:{{item.sailings}}</text><br>
				<text>所属区队:{{item.parentDeptName}}</text><br>
				<text>班组:{{item.deptName}}</text><br>
				<text>班组长:{{item.morName}}</text>
			</view>
			<button @click="start(index)">开始任务</button>
			<hr>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list:[
					{}
				],
				
			}
		},
		created() {
			this.getlist();
		},
		methods: {
			getlist(){
				var token = "eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjA1ZTRkOGZlLTU2ZDAtNGY1Mi04YjdjLTgyMGNkYzgwZjFhZSJ9.Ov1Tee8F0W3oaRXMzrhy8DNx2OPotyhscIW_7YNSSsIUW-PVxMXMRBQKQVQ5TWcgn406lzm3Y8JYxILhKoM_aQ";
				uni.request({	
					url:"/kyhs/task-inf-list",
					method:"GET",
					header:{'Authorization': token}
				}).then(Response => {
					this.list = Response.data.data;
				});
			},
			tomore(it){
				uni.navigateTo({
					url:"/pages/new/new?id="+it
				})
			},
			start(it){
				uni.navigateTo({
					url:"/pages/start/start"
				})
			}
		}
	}
</script>

<style>

</style>
